package com.zjut.szq.demo.service.test;

import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.zjut.szq.demo.model.Admin;
import com.zjut.szq.demo.service.AdminService;

public class testAdminService{
	
	ApplicationContext applicationContext;
	
	@Before
	public void init() {
		applicationContext = new ClassPathXmlApplicationContext("classpath:spring-base.xml");
	}

	@Test
	public void testLogin(){
		AdminService service = (AdminService) applicationContext.getBean("adminService");
		Admin admin = service.login("admin", "admin");
		Assert.assertNotNull(admin);
	}
}
